package com.haoma.elasticsearch;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * Description:
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@Document(indexName = "article")
public class ArticleEs {

    @Id
    private Long id;

    // 文章标题 需要分词
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String title;

    // 文章描述 不需要搜索
    @Field(index = false)
    private String describe;

    // 文章名称
    private String categoryName;

    // 文章标签
    private String labelName;

    // 不需要搜索
    @Field(type = FieldType.Keyword, index = false)
    private String cover;

    // 状态
    private Integer status;

    // 排序
    private Integer sort;

    // 热度
    private Integer hot;

    // 内容
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    @Field(type = FieldType.Keyword)
    private String createTime;
    @Field(type = FieldType.Keyword)
    private String updateTime;
}
